<!DOCTYPE HTML>
<html lang="zh-cn" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
        <title>介绍 | Domplate 文档</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="Domplate 的入门指引">
        <meta name="generator" content="GitBook 2.0.1">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        <link rel="stylesheet" href="gitbook/prettify/prettify.css" />
        
    
    
    <link rel="next" href="./usage/index.html" />
    
    

        
    </head>
    <body>
        
        
    <link rel="stylesheet" href="gitbook/style.css">
    
    

        
    <div class="book" data-level="0" data-basepath="." data-revision="Tue May 19 2015 01:42:16 GMT+0800 (CST)">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="输入并搜索" class="form-control" />
    </div>
    <ul class="summary">
        
        
        
        

        

        
    
        <li class="chapter active" data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                        <i class="fa fa-check"></i>
                        
                        介绍
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="usage/index.html">
            
                
                    <a href="./usage/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        用法
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="features/index.html">
            
                
                    <a href="./features/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        特性
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="features/expression.html">
            
                
                    <a href="./features/expression.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        表达式
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="features/init.html">
            
                
                    <a href="./features/init.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        数据初始化属性
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="features/flow.html">
            
                
                    <a href="./features/flow.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        流程控制属性
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="features/show.html">
            
                
                    <a href="./features/show.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        show
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="features/repeat.html">
            
                
                    <a href="./features/repeat.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.2.</b>
                        
                        repeat
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2.3.3" data-path="features/switch.html">
            
                
                    <a href="./features/switch.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.3.</b>
                        
                        switch
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="features/event.html">
            
                
                    <a href="./features/event.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        事件属性
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="jsapi/index.html">
            
                
                    <a href="./jsapi/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        JS 接口
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="jsapi/domplate.html">
            
                
                    <a href="./jsapi/domplate.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        domplate() 函数
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="jsapi/ctrl.html">
            
                
                    <a href="./jsapi/ctrl.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        ctrl 对象
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="jsapi/data.html">
            
                
                    <a href="./jsapi/data.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        ctrl.data 属性
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="jsapi/load.html">
            
                
                    <a href="./jsapi/load.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        ctrl.load() 方法
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="jsapi/methods.html">
            
                
                    <a href="./jsapi/methods.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        ctrl.methods() 方法
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="jsapi/update.html">
            
                
                    <a href="./jsapi/update.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        ctrl.update() 方法
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="about/me.html">
            
                
                    <a href="./about/me.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        其它
                    </a>
                
            
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                本书使用 GitBook 发布
            </a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="目录"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="搜索"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="字体设置"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">衬线体</button>
        <button type="button" data-font="1" class="button">无衬线体</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">白色</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">棕褐色</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">夜间</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="分享"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    分享到 Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    分享到 Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    分享到 Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    分享到 Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    分享到 Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >Domplate 文档</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="%E7%AE%80%E4%BB%8B">&#x7B80;&#x4ECB;</h1>
<p>domplate&#xFF0C;&#x540D;&#x5B57;&#x610F;&#x4E3A; dom template&#xFF0C;&#x662F;&#x4E00;&#x4E2A;&#x57FA;&#x4E8E; dom &#x7ED3;&#x6784;&#x7684;&#x524D;&#x7AEF;&#x6A21;&#x677F;&#x63A7;&#x5236;&#x5668;&#x3002;</p>
<h2 id="%E4%B8%80%E4%BA%9B%E7%89%B9%E7%82%B9">&#x4E00;&#x4E9B;&#x7279;&#x70B9;</h2>
<ul>
<li>&#x517C;&#x5BB9; IE8 &#x6D4F;&#x89C8;&#x5668;&#xFF1A;&#x56FD;&#x5185;&#x5E02;&#x573A;&#x7684;&#x9700;&#x6C42;</li>
<li>&#x5B9E;&#x73B0;&#x89C6;&#x56FE;&#x6700;&#x5C0F;&#x8303;&#x56F4;&#x66F4;&#x65B0;&#xFF1A;&#x6570;&#x636E;&#x6CA1;&#x53D8;&#x65F6;&#xFF0C;&#x76F8;&#x5E94;&#x7684; dom &#x8282;&#x70B9;&#x4E0D;&#x4F1A;&#x66F4;&#x65B0;</li>
<li>&#x5B9E;&#x73B0;&#x90E8;&#x5206;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x5C5E;&#x6027;</li>
<li>&#x4E0E; web-components &#x65E0;&#x5173;</li>
<li>&#x4E0E;&#x6570;&#x636E;&#x53CC;&#x5411;&#x7ED1;&#x5B9A;&#x65E0;&#x5173;</li>
</ul>
<h2 id="%E7%9C%8B%E7%9C%8B-demo-%E5%85%88">&#x770B;&#x770B; DEMO &#x5148;</h2>
<pre><code class="prettyprint lang-html">&lt;div id=&quot;demo&quot;&gt;
  &lt;p&gt;&#x8BA1;&#x6570;: &#x200C;{{ count }}&#x200D;&lt;/p&gt;
  &lt;p&gt;&#x8F93;&#x5165;&#xFF1A;&lt;input type=&quot;text&quot; value=&quot;&#x200C;{{ count }}&#x200D;&quot; onkeyup=&quot; &#x200C;$this.data.count&#x200D; = this.value; &quot;&gt;&lt;/p&gt;
  &lt;p&gt;
    &lt;button onclick=&quot; &#x200C;$this.data.count&#x200D; ++; &quot;&gt;&#x589E;&#x52A0;&lt;/button&gt;
    &lt;button onclick=&quot; &#x200C;$this.data.count&#x200D; --; &quot;&gt;&#x51CF;&#x5C11;&lt;/button&gt;
  &lt;/p&gt;
&lt;/div&gt;

&lt;script&gt;
  domplate( &quot;#demo&quot; ).load( { count: 0 } );
&lt;/script&gt;
</code></pre>
<div class="display-demo-link" data-name="event"></div>

<p>&#x53E6;&#x4E00;&#x4E2A; Demo &#x5B9E;&#x73B0;&#x4E86;&#x7B80;&#x5355;&#x7684; todo&#xFF0C;&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x4F60;&#x66F4;&#x52A0;&#x7CFB;&#x7EDF;&#x7684;&#x4E86;&#x89E3; domplate &#x7684;&#x529F;&#x80FD;&#xFF1A;</p>
<div class="display-demo-link" data-name="todo"></div>

<p>&#x9605;&#x8BFB;&#x4EE5;&#x4E0B;&#x5B50;&#x7AE0;&#x8282;&#x4EE5;&#x7EE7;&#x7EED;&#x4E86;&#x89E3;&#xFF1A;</p>
<div class="display-sub-chapter" data-root="" data-except="&#x4ECB;&#x7ECD;"></div>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        
        <a href="./usage/index.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 用法"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app-min.js"></script>
<script src="gitbook/prettify/prettify.js"></script>
<script src="./common/inject-min.js"></script>

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
